//#include<bits/stdc++.h>
#include <iostream>
#include<algorithm>
#include<queue>
typedef unsigned long long ull;
using namespace std;


int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int n, d;
	cin >> n >> d;
	double kucun[10005] = { 0 }, sales[10005] = { 0 };
	priority_queue<pair<double, int>> pq;
	for (int i = 0;i < n;i++) {
		cin >> kucun[i];
	}
	for (int j = 0;j < n;j++) {
		cin >> sales[j];
	}
	for (int i = 0;i < n;i++) {
		pq.push({ sales[i] * 1.0 / kucun[i],i });
	}
	double ans = 0;
	while (d>0&& !pq.empty()) {
		pair<double, int> p = pq.top();
		pq.pop();
		if (kucun[p.second] < d) {
			ans += sales[p.second];
			d -= kucun[p.second];
		}
		else
		{
			ans += (p.first * d*1.0);
			d = 0;
		}
	}
	printf("%.2lf\n", ans);
	//cout << ans << endl;
	return 0;
}